/*
 * @Author: wangqizhang
 * @Date: 2024-04-22 16:54:00
 * @LastEditors: wangqizhang
 * @LastEditTime: 2024-05-12 14:42:33
 * @FilePath: /suixinji-react/src/api/index.ts
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */

import request from '../api/request';
//查询所有分组列表
export const getGroupList = async () => {
  return request.get({
    url: '/group/groupList',
  });
};
//添加分组
export const addGroup = async (data: any) => {
  return request.post({
    url: '/group/add',
    data,
  });
};
//添加笔记
export const addNote = async (data: any) => {
  return request.post({
    url: '/note/add',
    data,
  });
};
//根据分组id查询笔记列表
export const getNoteLitByGroupId = async (id: any) => {
  return request.get({
    url: '/note/getNoteByGroupId?id=' + id,
  });
};
//更新笔记
export const updateNote = async (data: any) => {
  return request.post({
    url: '/note/edit?id=' + data.id,
    data,
  });
};
//获取默认分组
export const getDefaultGroup = async () => {
  return request.get({
    url: '/note/defaultGroup',
  });
};
//分页获取分组列表
export const getGroupListByPage = async (data: any) => {
  return request.post({
    url: '/group/findList/query',
    data,
  });
};
